
package it.csttech.date;

import java.util.Date;

import javax.validation.constraints.NotNull;
import javax.ws.rs.MatrixParam;
import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;

/**
 * This class represents an object whose attributes are defined through a
 * queryparam, a pathparam and a matrixparam
 * 
 * @author marcello.felappi
 * @author marco.dalena
 */
public class ParamComplexObject {

	@NotNull
	@QueryParam("date")
	private Date date;
	@NotNull
	@PathParam("string")
	private String string;
	@NotNull
	@MatrixParam("float")
	private Float decimal;

	public ParamComplexObject(Date date, String string, Float decimal) {

		this.date = date;
		this.string = string;
		this.decimal = decimal;
	}

	public ParamComplexObject() {

	}

	public Date getDate() {

		return date;
	}

	public void setDate(Date date) {

		this.date = date;
	}

	public String getString() {

		return string;
	}

	public void setString(String string) {

		this.string = string;
	}

	public Float getDecimal() {

		return decimal;
	}

	public void setDecimal(Float decimal) {

		System.out.println("sto settando un float");
		this.decimal = decimal;
	}

	@Override
	public String toString() {

		StringBuilder builder = new StringBuilder();
		builder.append("ParamComplexObject [date=");
		builder.append(date);
		builder.append(", string=");
		builder.append(string);
		builder.append(", decimal=");
		builder.append(decimal);
		builder.append("]");
		return builder.toString();
	}

}
